package com.team.owner.controller;

import com.team.owner.model.CodeVo;
import com.team.owner.model.OwnerQueryVo;
import com.team.owner.model.QueryWareVo;
import com.team.owner.model.UpdateVo;
import com.team.owner.service.OwnerService;
import com.team.util.ResultVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by 李红历 on 2022/7/12.
 * lhl
 */
@RestController
@CrossOrigin//支持跨域
@Api(value="OwnerController" ,description="库房归属")
@RequestMapping("owner")//统一接口请求地址price
public class OwnerController {
    @Autowired
    private OwnerService ownerService;
    @PostMapping("queryPage")
    public ResultVo queryPage(@RequestBody OwnerQueryVo ownerQueryVo){
        return ownerService.queryPage(ownerQueryVo);
    }

    @PostMapping("queryware")
    public ResultVo queryware(@RequestBody QueryWareVo queryWareVo){
        return ownerService.queryware(queryWareVo);
    }

    @PostMapping("queryareaByCode")
    public ResultVo queryareaByCode(@RequestBody List<CodeVo> stockRoomCodeLists){
        return ownerService.queryareaByCode(stockRoomCodeLists);
    }

    @PostMapping("queryseatByCode")
    public ResultVo queryseatByCode(@RequestBody List<CodeVo> wareAreaCodeLists){
        return ownerService.queryseatByCode(wareAreaCodeLists);
    }

    @PostMapping("querylegalPersonCode")
    public ResultVo querylegalPersonCode(String legalPersonCode){
        return ownerService.querylegalPersonCode(legalPersonCode);
    }

    @PostMapping("update")
    public ResultVo update(@RequestBody UpdateVo updateVo){
        return ownerService.update(updateVo);
    }
}
